package com.dz51.core.validate.validator.handler;  

import javax.servlet.http.HttpServletRequest;

import com.dz51.core.validate.annotation.ParamValidater;
import com.dz51.core.validate.util.ValidateResultBulider;
import com.dz51.core.validate.validator.strategy.ValidateModel;
import com.dz51.core.validate.vo.ValidateResult;

public class ValidateExecuter implements Validator{

    @Override
    public ValidateResult validate(HttpServletRequest request, ParamValidater paramValidater, ValidateModel validateModel) {
        if(validateModel == null || request == null || paramValidater.name() == null){
            return ValidateResultBulider.createSuccessResult(request);
        }
        return validateModel.validate(request, paramValidater);
    }

}
